package com.hx.srv;

/**
 * @author minghuaChan
 * @since 2023/10/18 22:55
 */
import com.hx.entity.Person;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;

import javax.validation.Valid;


@Service
@Validated
public class PersonService {


    /**
     * 这里有坑：在这个spring版本下，必须使用的是@Valid 这个注解才生效
     * @param person
     */
    public void savePerson(@Valid Person person) {
        // Your service logic
        // This method will automatically trigger validation on the 'Person' object
    }
}

